package com.xqh.javabasic.array_max_min;
public class Array_Max_Min{
		
	public static int find_max(int [] arr){
		int m =arr [0];
		int x =0;
	while(x < arr.length){
	
		if(m < arr [x]){
		
			m = arr[x];
			}
			x++;
		}
	   return m;
	}
	public static int find_min(int [] arr){
		int m =arr [0];
		int x =0;
	while(x < arr.length){
	
		if(m > arr [x]){
		
			m = arr[x];
			}
			x++;
	
	}
	return m;
}


public static void main(String [] args){

		//int [] a = {9,55,17,-4,45676,0,9,99,7,-9899};
		int [] a = {9,55,17,-4};
		
		int max = Array_Max_Min.find_max(a);

		int min = Array_Max_Min.find_min(a);
		System.out.println(max + "," + min);
	}
}	